package org.tigris.atlas.quizme.service.impl;

import org.tigris.atlas.quizme.bizobj.AnswerBO;
import org.tigris.atlas.quizme.bizobj.BusinessObjectFactory;
import org.tigris.atlas.quizme.bizobj.QuestionBO;
import org.tigris.atlas.quizme.bizobj.QuizTopicBO;
import org.tigris.atlas.quizme.bizobj.UserProfileBO;
import org.tigris.atlas.quizme.enumeration.GenderEnumeration;
import org.tigris.atlas.service.VoidServiceResponse;


/**
 * Service implementation class for the DatabaseSetup service
 * @see org.tigris.atlas.quizme.service.DatabaseSetupService
 */
public class DatabaseSetupServiceImpl extends DatabaseSetupServiceBaseImpl {

	/**
	 * Execute the SetupData service
	 * @see org.tigris.atlas.quizme.service.DatabaseSetupService#SetupData()
	 */
	protected void setupDataImpl(VoidServiceResponse response) {
		
		
		QuizTopicBO quizTopic = BusinessObjectFactory.createQuizTopicBO();
		quizTopic.setTopicName("Atlas");
		quizTopic.save();
		
		UserProfileBO user = BusinessObjectFactory.createUserProfileBO();
		user.setFirstName("test");
		user.setLastName("test");
		user.setEmail("test@test.com");
		user.setUsername("test");
		user.setPassword("test");
		user.setGender(GenderEnumeration.getEnum(GenderEnumeration.M));
		user.save();
		
		QuestionBO question1 = BusinessObjectFactory.createQuestionBO();
		question1.setQuestion("What types of architectures does Atlas inherently utilize to provide high quality solutions at low cost?");
		question1.setQuizTopic(quizTopic);
		question1.setAnswerCount(new Integer(5));
		question1.setMultiAnswer(Boolean.TRUE);
		AnswerBO answer1_1 = BusinessObjectFactory.createAnswerBO();
		answer1_1.setAnswer("Service-Oriented Architecture");
		answer1_1.setCorrect(Boolean.TRUE);
		answer1_1.setOrder(new Integer(1));
		question1.addAnswer(answer1_1);
		AnswerBO answer1_2 = BusinessObjectFactory.createAnswerBO();
		answer1_2.setAnswer("Model-Driven Architecture");
		answer1_2.setCorrect(Boolean.TRUE);
		answer1_2.setOrder(new Integer(2));
		question1.addAnswer(answer1_2);
		AnswerBO answer1_3 = BusinessObjectFactory.createAnswerBO();
		answer1_3.setAnswer("Reinvented Wheel Architecture");
		answer1_3.setCorrect(Boolean.FALSE);
		answer1_3.setOrder(new Integer(3));
		question1.addAnswer(answer1_3);
		AnswerBO answer1_4 = BusinessObjectFactory.createAnswerBO();
		answer1_4.setAnswer("Microsoft Architecture");
		answer1_4.setCorrect(Boolean.FALSE);
		answer1_4.setOrder(new Integer(4));
		question1.addAnswer(answer1_4);
		AnswerBO answer1_5 = BusinessObjectFactory.createAnswerBO();
		answer1_5.setAnswer("Romanesque Architecture");
		answer1_5.setCorrect(Boolean.FALSE);
		answer1_5.setOrder(new Integer(5));
		question1.addAnswer(answer1_5);
		question1.save();
		
		QuestionBO question2 = BusinessObjectFactory.createQuestionBO();
		question2.setQuestion("What is the Atlas metadata based on?");
		question2.setQuizTopic(quizTopic);
		question2.setAnswerCount(new Integer(5));
		question2.setMultiAnswer(Boolean.TRUE);
		AnswerBO answer2_1 = BusinessObjectFactory.createAnswerBO();
		answer2_1.setAnswer("Domain Specific Languages (DSL)");
		answer2_1.setCorrect(Boolean.FALSE);
		answer2_1.setOrder(new Integer(1));
		question2.addAnswer(answer2_1);
		AnswerBO answer2_2 = BusinessObjectFactory.createAnswerBO();
		answer2_2.setAnswer("Eclipse Modeling Framework (EMF)");
		answer2_2.setCorrect(Boolean.FALSE);
		answer2_2.setOrder(new Integer(2));
		question2.addAnswer(answer2_2);
		AnswerBO answer2_3 = BusinessObjectFactory.createAnswerBO();
		answer2_3.setAnswer("Meta-Object Facility (MOF)");
		answer2_3.setCorrect(Boolean.TRUE);
		answer2_3.setOrder(new Integer(3));
		question2.addAnswer(answer2_3);
		AnswerBO answer2_4 = BusinessObjectFactory.createAnswerBO();
		answer2_4.setAnswer("Visio");
		answer2_4.setCorrect(Boolean.FALSE);
		answer2_4.setOrder(new Integer(4));
		question2.addAnswer(answer2_4);
		AnswerBO answer2_5 = BusinessObjectFactory.createAnswerBO();
		answer2_5.setAnswer("Unified Modeling Language (UML)");
		answer2_5.setCorrect(Boolean.TRUE);
		answer2_5.setOrder(new Integer(5));
		question2.addAnswer(answer2_5);
		question2.save();
		
		QuestionBO question3 = BusinessObjectFactory.createQuestionBO();
		question3.setQuestion("Atlas model transformations are implemented using:");
		question3.setQuizTopic(quizTopic);
		question3.setAnswerCount(new Integer(4));
		question3.setMultiAnswer(Boolean.FALSE);
		AnswerBO answer3_1 = BusinessObjectFactory.createAnswerBO();
		answer3_1.setAnswer("Magic");
		answer3_1.setCorrect(Boolean.FALSE);
		answer3_1.setOrder(new Integer(1));
		question3.addAnswer(answer3_1);
		AnswerBO answer3_2 = BusinessObjectFactory.createAnswerBO();
		answer3_2.setAnswer("Velocity");
		answer3_2.setCorrect(Boolean.TRUE);
		answer3_2.setOrder(new Integer(2));
		question3.addAnswer(answer3_2);
		AnswerBO answer3_3 = BusinessObjectFactory.createAnswerBO();
		answer3_3.setAnswer("XSLT");
		answer3_3.setCorrect(Boolean.FALSE);
		answer3_3.setOrder(new Integer(3));
		question3.addAnswer(answer3_3);
		AnswerBO answer3_4 = BusinessObjectFactory.createAnswerBO();
		answer3_4.setAnswer("XQuery");
		answer3_4.setCorrect(Boolean.FALSE);
		answer3_4.setOrder(new Integer(4));
		question3.addAnswer(answer3_4);
		question3.save();
		
		QuestionBO question4 = BusinessObjectFactory.createQuestionBO();
		question4.setQuestion("Atlas-Java leverages:");
		question4.setQuizTopic(quizTopic);
		question4.setAnswerCount(new Integer(5));
		question4.setMultiAnswer(Boolean.FALSE);
		AnswerBO answer4_1 = BusinessObjectFactory.createAnswerBO();
		answer4_1.setAnswer("Hibernate");
		answer4_1.setCorrect(Boolean.FALSE);
		answer4_1.setOrder(new Integer(1));
		question4.addAnswer(answer4_1);
		AnswerBO answer4_2 = BusinessObjectFactory.createAnswerBO();
		answer4_2.setAnswer("Spring");
		answer4_2.setCorrect(Boolean.FALSE);
		answer4_2.setOrder(new Integer(2));
		question4.addAnswer(answer4_2);
		AnswerBO answer4_3 = BusinessObjectFactory.createAnswerBO();
		answer4_3.setAnswer("Struts");
		answer4_3.setCorrect(Boolean.FALSE);
		answer4_3.setOrder(new Integer(3));
		question4.addAnswer(answer4_3);
		AnswerBO answer4_4 = BusinessObjectFactory.createAnswerBO();
		answer4_4.setAnswer("All of the above");
		answer4_4.setCorrect(Boolean.FALSE);
		answer4_4.setOrder(new Integer(4));
		question4.addAnswer(answer4_4);
		AnswerBO answer4_5 = BusinessObjectFactory.createAnswerBO();
		answer4_5.setAnswer("None of the above");
		answer4_5.setCorrect(Boolean.TRUE);
		answer4_5.setOrder(new Integer(4));
		question4.addAnswer(answer4_5);
		question4.save();

		QuestionBO question5 = BusinessObjectFactory.createQuestionBO();
		question5.setQuestion("Atlas supports generation of applications based on:");
		question5.setQuizTopic(quizTopic);
		question5.setAnswerCount(new Integer(5));
		question5.setMultiAnswer(Boolean.TRUE);
		AnswerBO answer5_1 = BusinessObjectFactory.createAnswerBO();
		answer5_1.setAnswer("J2EE");
		answer5_1.setCorrect(Boolean.FALSE);
		answer5_1.setOrder(new Integer(1));
		question5.addAnswer(answer5_1);
		AnswerBO answer5_2 = BusinessObjectFactory.createAnswerBO();
		answer5_2.setAnswer("Ruby on Rails");
		answer5_2.setCorrect(Boolean.FALSE);
		answer5_2.setOrder(new Integer(2));
		question5.addAnswer(answer5_2);
		AnswerBO answer5_3 = BusinessObjectFactory.createAnswerBO();
		answer5_3.setAnswer(".NET");
		answer5_3.setCorrect(Boolean.FALSE);
		answer5_3.setOrder(new Integer(3));
		question5.addAnswer(answer5_3);
		AnswerBO answer5_4 = BusinessObjectFactory.createAnswerBO();
		answer5_4.setAnswer("All of the above");
		answer5_4.setCorrect(Boolean.TRUE);
		answer5_4.setOrder(new Integer(4));
		question5.addAnswer(answer5_4);
		AnswerBO answer5_5 = BusinessObjectFactory.createAnswerBO();
		answer5_5.setAnswer("None of the above");
		answer5_5.setCorrect(Boolean.FALSE);
		answer5_5.setOrder(new Integer(4));
		question5.addAnswer(answer5_5);
		question5.save();
		
		QuestionBO question6 = BusinessObjectFactory.createQuestionBO();
		question6.setQuestion("An application profile is based on:");
		question6.setQuizTopic(quizTopic);
		question6.setAnswerCount(new Integer(5));
		question6.setMultiAnswer(Boolean.TRUE);
		AnswerBO answer6_1 = BusinessObjectFactory.createAnswerBO();
		answer6_1.setAnswer("Application framework");
		answer6_1.setCorrect(Boolean.TRUE);
		answer6_1.setOrder(new Integer(1));
		question6.addAnswer(answer6_1);
		AnswerBO answer6_2 = BusinessObjectFactory.createAnswerBO();
		answer6_2.setAnswer("Application metadata");
		answer6_2.setCorrect(Boolean.FALSE);
		answer6_2.setOrder(new Integer(2));
		question6.addAnswer(answer6_2);
		AnswerBO answer6_3 = BusinessObjectFactory.createAnswerBO();
		answer6_3.setAnswer("Framework plug-ins");
		answer6_3.setCorrect(Boolean.TRUE);
		answer6_3.setOrder(new Integer(3));
		question6.addAnswer(answer6_3);
		AnswerBO answer6_4 = BusinessObjectFactory.createAnswerBO();
		answer6_4.setAnswer("All of the above");
		answer6_4.setCorrect(Boolean.FALSE);
		answer6_4.setOrder(new Integer(4));
		question6.addAnswer(answer6_4);
		AnswerBO answer6_5 = BusinessObjectFactory.createAnswerBO();
		answer6_5.setAnswer("None of the above");
		answer6_5.setCorrect(Boolean.FALSE);
		answer6_5.setOrder(new Integer(4));
		question6.addAnswer(answer6_5);
		question6.save();
		
		QuestionBO question7 = BusinessObjectFactory.createQuestionBO();
		question7.setQuestion("Any combination of plug-ins may be used to generate a working application.");
		question7.setQuizTopic(quizTopic);
		question7.setAnswerCount(new Integer(2));
		question7.setMultiAnswer(Boolean.FALSE);
		AnswerBO answer7_1 = BusinessObjectFactory.createAnswerBO();
		answer7_1.setAnswer("True");
		answer7_1.setCorrect(Boolean.FALSE);
		answer7_1.setOrder(new Integer(1));
		question7.addAnswer(answer7_1);
		AnswerBO answer7_2 = BusinessObjectFactory.createAnswerBO();
		answer7_2.setAnswer("False");
		answer7_2.setCorrect(Boolean.TRUE);
		answer7_2.setOrder(new Integer(2));
		question7.addAnswer(answer7_2);
		question7.save();
		
		QuestionBO question8 = BusinessObjectFactory.createQuestionBO();
		question8.setQuestion("An application framework provides an implementation of the:");
		question8.setQuizTopic(quizTopic);
		question8.setAnswerCount(new Integer(5));
		question8.setMultiAnswer(Boolean.TRUE);
		AnswerBO answer8_1 = BusinessObjectFactory.createAnswerBO();
		answer8_1.setAnswer("Platform Independent Model (PIM)");
		answer8_1.setCorrect(Boolean.FALSE);
		answer8_1.setOrder(new Integer(1));
		question8.addAnswer(answer8_1);
		AnswerBO answer8_2 = BusinessObjectFactory.createAnswerBO();
		answer8_2.setAnswer("Key Abstractions");
		answer8_2.setCorrect(Boolean.FALSE);
		answer8_2.setOrder(new Integer(2));
		question8.addAnswer(answer8_2);
		AnswerBO answer8_3 = BusinessObjectFactory.createAnswerBO();
		answer8_3.setAnswer("Platform Specific Model (PSM)");
		answer8_3.setCorrect(Boolean.TRUE);
		answer8_3.setOrder(new Integer(3));
		question8.addAnswer(answer8_3);
		AnswerBO answer8_4 = BusinessObjectFactory.createAnswerBO();
		answer8_4.setAnswer("Use Case Model");
		answer8_4.setCorrect(Boolean.FALSE);
		answer8_4.setOrder(new Integer(4));
		question8.addAnswer(answer8_4);
		AnswerBO answer8_5 = BusinessObjectFactory.createAnswerBO();
		answer8_5.setAnswer("Architectural Mechanisms");
		answer8_5.setCorrect(Boolean.TRUE);
		answer8_5.setOrder(new Integer(5));
		question8.addAnswer(answer8_5);
		question8.save();
		
		QuestionBO question9 = BusinessObjectFactory.createQuestionBO();
		question9.setQuestion("Used properly Atlas can increase:");
		question9.setQuizTopic(quizTopic);
		question9.setAnswerCount(new Integer(4));
		question9.setMultiAnswer(Boolean.TRUE);
		AnswerBO answer9_1 = BusinessObjectFactory.createAnswerBO();
		answer9_1.setAnswer("Application Quality");
		answer9_1.setCorrect(Boolean.TRUE);
		answer9_1.setOrder(new Integer(1));
		question9.addAnswer(answer9_1);
		AnswerBO answer9_2 = BusinessObjectFactory.createAnswerBO();
		answer9_2.setAnswer("Developer Productivity");
		answer9_2.setCorrect(Boolean.TRUE);
		answer9_2.setOrder(new Integer(2));
		question9.addAnswer(answer9_2);
		AnswerBO answer9_3 = BusinessObjectFactory.createAnswerBO();
		answer9_3.setAnswer("Developer Height");
		answer9_3.setCorrect(Boolean.FALSE);
		answer9_3.setOrder(new Integer(3));
		question9.addAnswer(answer9_3);
		AnswerBO answer9_4 = BusinessObjectFactory.createAnswerBO();
		answer9_4.setAnswer("Application Resiliency to Change");
		answer9_4.setCorrect(Boolean.TRUE);
		answer9_4.setOrder(new Integer(4));
		question9.addAnswer(answer9_4);
		question9.save();

		QuestionBO question10 = BusinessObjectFactory.createQuestionBO();
		question10.setQuestion("The Atlas Metadata is a Representation of the:");
		question10.setQuizTopic(quizTopic);
		question10.setAnswerCount(new Integer(4));
		question10.setMultiAnswer(Boolean.TRUE);
		AnswerBO answer10_1 = BusinessObjectFactory.createAnswerBO();
		answer10_1.setAnswer("Platform Specific Model (PSM)");
		answer10_1.setCorrect(Boolean.FALSE);
		answer10_1.setOrder(new Integer(1));
		question10.addAnswer(answer10_1);
		AnswerBO answer10_2 = BusinessObjectFactory.createAnswerBO();
		answer10_2.setAnswer("Supplementary Specifications");
		answer10_2.setCorrect(Boolean.FALSE);
		answer10_2.setOrder(new Integer(2));
		question10.addAnswer(answer10_2);
		AnswerBO answer10_3 = BusinessObjectFactory.createAnswerBO();
		answer10_3.setAnswer("Platform Independent Model (PIM)");
		answer10_3.setCorrect(Boolean.TRUE);
		answer10_3.setOrder(new Integer(3));
		question10.addAnswer(answer10_3);
		AnswerBO answer10_4 = BusinessObjectFactory.createAnswerBO();
		answer10_4.setAnswer("Key Abstractions");
		answer10_4.setCorrect(Boolean.TRUE);
		answer10_4.setOrder(new Integer(4));
		question10.addAnswer(answer10_4);
		question10.save();

		QuestionBO question11 = BusinessObjectFactory.createQuestionBO();
		question11.setQuestion("Atlas eliminates the need for a development process.");
		question11.setQuizTopic(quizTopic);
		question11.setAnswerCount(new Integer(2));
		question11.setMultiAnswer(Boolean.FALSE);
		AnswerBO answer11_1 = BusinessObjectFactory.createAnswerBO();
		answer11_1.setAnswer("True");
		answer11_1.setCorrect(Boolean.FALSE);
		answer11_1.setOrder(new Integer(1));
		question11.addAnswer(answer11_1);
		AnswerBO answer11_2 = BusinessObjectFactory.createAnswerBO();
		answer11_2.setAnswer("False");
		answer11_2.setCorrect(Boolean.TRUE);
		answer11_2.setOrder(new Integer(2));
		question11.addAnswer(answer11_2);
		question11.save();
	}

}